/*
 * @Author: ducafecat
 * @Description: 列表页
 * @Date: 2018-04-13 16:13:27
 * @Last Modified by: hans.taozhiwei
 * @Last Modified time: 2018-04-13 16:15:33
 */

const app = {
  state: {
    name: '',
    optionSelect: [
      {
        value: 1,
        label: 'A:'
      },
      {
        value: 2,
        label: 'B:'
      },
      {
        value: 3,
        label: 'C:'
      },
      {
        value: 4,
        label: 'D:'
      }
    ]
  },
  mutations: {
    SET_NAME: (state, name) => {
      state.name = name
    }
  },
  actions: {
    setName ({ commit }, userInfo) {
      const username = userInfo.username.trim()
      return new Promise((resolve, reject) => {
        commit('SET_NAME', username)
        resolve()
      })
    }
  }
}

export default app
